home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / muirexx2.1 / demos / muirexxbuild / set_object.rexx < prev    next >
OS/2 REXX Batch file  |  1996-08-24  |  12KB  |  490 lines

  1. /* */
  2. options results
  3. parse arg '['obj']'
  4.  
  5. address BUILD
  6.  
  7. parse var obj gobj .
  8. select
  9.     when index(gobj,'window') > 0 then call set_window(obj)
  10.     when index(gobj,'group') > 0 then call set_group(obj)
  11.     when index(gobj,'menu') > 0 then call set_menu(obj)
  12.     when index(gobj,'do') > 0 then call set_do(obj)
  13.     when index(gobj,'item') > 0 then call set_item(obj)
  14.     when index(gobj,'space') > 0 then call set_space(obj)
  15.     when index(gobj,'label') > 0 then call set_label(obj)
  16.     when index(gobj,'view') > 0 then call set_view(obj)
  17.     when index(gobj,'gauge') > 0 then call set_gauge(obj)
  18.     when index(gobj,'meter') > 0 then call set_gauge(obj)
  19.     when index(gobj,'button') > 0 then call set_gadget(obj)
  20.     when index(gobj,'text') > 0 then call set_gadget(obj)
  21.     when index(gobj,'switch') > 0 then call set_gadget(obj)
  22.     when index(gobj,'image') > 0 then call set_image(obj)
  23.     when index(gobj,'check') > 0 then call set_image(obj)
  24.     when index(gobj,'cycle') > 0 then call set_cycle(obj)
  25.     when index(gobj,'radio') > 0 then call set_cycle(obj)
  26.     when index(gobj,'string') > 0 then call set_string(obj)
  27.     when index(gobj,'popasl') > 0 then call set_string(obj)
  28.     when index(gobj,'poplist') > 0 then call set_string(obj)
  29.     when index(gobj,'slider') > 0 then call set_slider(obj)
  30.     when index(gobj,'popslider') > 0 then call set_slider(obj)
  31.     when index(gobj,'knob') > 0 then call set_slider(obj)
  32.     when index(gobj,'dirlist') > 0 then call set_dirlist(obj)
  33.     when index(gobj,'volumelist') > 0 then call set_volumelist(obj)
  34.     when index(gobj,'list') > 0 then call set_list(obj)
  35.     when index(gobj,'object') > 0 then call set_object(obj)
  36.     when index(gobj,'application') > 0 then call set_application(obj)
  37.     when index(gobj,'method') > 0 then call set_method(obj)
  38.     otherwise call set_generic(obj)
  39. end
  40.  
  41. exit
  42.  
  43. set_window: procedure
  44. parse arg obj
  45.  
  46. line = obj
  47. string ID S1
  48. if result ~= '' then line = line||' ID '||result
  49. popasl ID S2
  50. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  51. string ID S3
  52. if result ~= '' then line = line||' PORT '||result
  53. string ID S4
  54. if result ~= '' then line = line||' TITLE """'||result||'"""'
  55. line = line||get_attrs()
  56. call finish line
  57. return
  58.  
  59. set_group: procedure
  60. parse arg obj
  61.  
  62. line = obj
  63. string ID S1
  64. if result ~= '' then line = line||' ID '||result
  65. popasl ID S2
  66. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  67. string ID S3
  68. if result ~= '' then line = line||' PORT '||result
  69. string ID S4
  70. if result ~= '' then line = line||' LABELS """'||result||'"""'
  71. check ID C1
  72. if result then line = line||' FRAME'
  73. check ID C2
  74. if result then line = line||' HORIZ'
  75. cycle ID L1
  76. if result ~= 'NORMAL' then line = line||' '||upper(result)
  77. line = line||get_attrs()
  78. call finish line
  79. return
  80.  
  81. set_menu: procedure
  82. parse arg obj
  83.  
  84. line = obj
  85. string ID S1
  86. if result ~= '' then line = line||' ID '||result
  87. string ID S2
  88. if result ~= '' then line = line||' LABEL """'||result||'"""'
  89. line = line||get_attrs()
  90. call finish line
  91. return
  92.  
  93. set_do: procedure
  94. parse arg obj
  95.  
  96. line = obj
  97. string ID P1
  98. if result ~= '' then line = line||' '||strip(result)
  99. string ID P2
  100. if result ~= '' then line = line||' = '||strip(result)
  101. string ID P3
  102. if result ~= '' then line = line||' to '||strip(result)
  103. call finish line
  104. return
  105.  
  106. set_item: procedure
  107. parse arg obj
  108.  
  109. line = obj
  110. string ID S1
  111. if result ~= '' then line = line||' ID '||result
  112. popasl ID S2
  113. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  114. string ID S3
  115. if result ~= '' then line = line||' PORT '||result
  116. string ID S4
  117. if result ~= '' then line = line||' LABEL """'||result||'"""'
  118. line = line||get_attrs()
  119. call finish line
  120. return
  121.  
  122. set_space: procedure
  123. parse arg obj
  124.  
  125. line = obj
  126. check ID C1
  127. if result then line = line||' BAR'
  128. check ID C2
  129. if result then line = line||' HORIZ'
  130. string ID S1
  131. if result ~= '' then line = line||' '||result
  132. call finish line
  133. return
  134.  
  135. set_label: procedure
  136. parse arg obj
  137.  
  138. line = obj
  139. check ID C1
  140. if result then line = line||' LEFT'
  141. check ID C2
  142. if result then line = line||' CENTER'
  143. check ID C3
  144. if result then line = line||' SINGLE'
  145. check ID C4
  146. if result then line = line||' DOUBLE'
  147. string ID S1
  148. if result ~= '' then line = line||' """'||result||'"""'
  149. call finish line
  150. return
  151.  
  152. set_view: procedure
  153. parse arg obj
  154.  
  155. line = obj
  156. string ID S1
  157. if result ~= '' then line = line||' ID '||result
  158. string ID S2
  159. if result ~= '' then line = line||' HELP """'||result||'"""'
  160. string ID S3
  161. if result ~= '' then line = line||' NODE '||result
  162. popasl ID S4
  163. if result ~= '' then line = line||' FILE '||result
  164. line = line||get_attrs()
  165. string ID S5
  166. if result ~= '' then line = line||' STRING "'||result||'"'
  167. call finish line
  168. return
  169.  
  170. set_gauge: procedure
  171. parse arg obj
  172.  
  173. line = obj
  174. string ID S1
  175. if result ~= '' then line = line||' ID '||result
  176. string ID S2
  177. if result ~= '' then line = line||' HELP """'||result||'"""'
  178. string ID S3
  179. if result ~= '' then line = line||' NODE '||result
  180. string ID S4
  181. if result ~= '' then line = line||' LABEL """'||result||'"""'
  182. line = line||get_attrs()
  183. call finish line
  184. return
  185.  
  186. set_gadget: procedure
  187. parse arg obj
  188.  
  189. line = obj
  190. string ID S1
  191. if result ~= '' then line = line||' ID '||result
  192. popasl ID S2
  193. gcommand = result
  194. if gcommand ~= '' then do
  195.     cycle ID L1
  196.     line = line||' '||upper(result)||' COMMAND """'||gcommand||'"""'
  197. end
  198. string ID S3
  199. if result ~= '' then line = line||' PORT '||result
  200. string ID S4
  201. if result ~= '' then line = line||' HELP """'||result||'"""'
  202. string ID S5
  203. if result ~= '' then line = line||' NODE '||result
  204. popasl ID S7
  205. name = result
  206. cycle ID L2
  207. type = result
  208. if name ~= '' then do
  209.     select
  210.         when type = 'Icon' then line = line||' ICON "'||name||'"'
  211.         when type = 'Picture' then do
  212.             line = line||' PICT "'||name||'"'
  213.             check ID C1
  214.             if result then line = line||' TRANS'
  215.         end
  216.         otherwise nop
  217.     end
  218. end
  219. line = line||get_attrs()
  220. string ID S6
  221. if result ~= '' then line = line||' LABEL "'||result||'"'
  222. call finish line
  223. return
  224.  
  225. set_image: procedure
  226. parse arg obj
  227.  
  228. line = obj
  229. string ID S1
  230. if result ~= '' then line = line||' ID '||result
  231. popasl ID S2
  232. if result ~= '' then line = line||' COMMAND """'||gcommand||'"""'
  233. string ID S3
  234. if result ~= '' then line = line||' PORT '||result
  235. string ID S4
  236. if result ~= '' then line = line||' HELP """'||result||'"""'
  237. string ID S5
  238. if result ~= '' then line = line||' NODE '||result
  239. string ID S6
  240. if result ~= '' then line = line||' STRINGS '||result
  241. cycle ID R1
  242. spec = result
  243. poplist ID S7
  244. sval = result
  245. if spec = 6 then do
  246.     sname = sval
  247.     call open('images','build:images.lst','R')
  248.     do while ~eof('images')
  249.         iline = readln('images')
  250.         if iline = '' then leave
  251.         parse var iline vname '=' value .
  252.         if index(vname,sname) > 0 then do
  253.             sval = value
  254.             leave
  255.         end
  256.     end
  257.     call close('images')
  258.     if sval = 15 then sval = ''
  259. end
  260. if sval ~= '' then line = line||' SPEC "'||spec':'sval||'"'
  261. line = line||get_attrs()
  262. call finish line
  263. return
  264.  
  265. set_cycle: procedure
  266. parse arg obj
  267.  
  268. line = obj
  269. string ID S1
  270. if result ~= '' then line = line||' ID '||result
  271. popasl ID S2
  272. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  273. string ID S3
  274. if result ~= '' then line = line||' PORT '||result
  275. string ID S4
  276. if result ~= '' then line = line||' HELP """'||result||'"""'
  277. string ID S5
  278. if result ~= '' then line = line||' NODE '||result
  279. string ID S6
  280. if result ~= '' then line = line||' LABELS """'||result||'"""'
  281. line = line||get_attrs()
  282. call finish line
  283. return
  284.  
  285. set_string: procedure
  286. parse arg obj
  287.  
  288. line = obj
  289. string ID S1
  290. if result ~= '' then line = line||' ID '||result
  291. popasl ID S2
  292. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  293. string ID S3
  294. if result ~= '' then line = line||' PORT '||result
  295. string ID S4
  296. if result ~= '' then line = line||' HELP """'||result||'"""'
  297. string ID S5
  298. if result ~= '' then line = line||' NODE '||result
  299. if index(obj,'poplist') > 0 then do
  300.     string ID S7
  301.     if result ~= '' then line = line||' LABELS """'||result||'"""'
  302. end
  303. line = line||get_attrs()
  304. string ID S6
  305. if result ~= '' then line = line||' CONTENT "'||result||'"'
  306. call finish line
  307. return
  308.  
  309. set_slider: procedure
  310. parse arg obj
  311.  
  312. line = obj
  313. string ID S1
  314. if result ~= '' then line = line||' ID '||result
  315. popasl ID S2
  316. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  317. string ID S3
  318. if result ~= '' then line = line||' PORT '||result
  319. string ID S4
  320. if result ~= '' then line = line||' HELP """'||result||'"""'
  321. string ID S5
  322. if result ~= '' then line = line||' NODE '||result
  323. line = line||get_attrs()
  324. call finish line
  325. return
  326.  
  327. set_list: procedure
  328. parse arg obj
  329.  
  330. line = obj
  331. string ID S1
  332. if result ~= '' then line = line||' ID '||result
  333. popasl ID S2
  334. gcommand = result
  335. if gcommand ~= '' then do
  336.     cycle ID L1
  337.     line = line||' '||upper(result)||' COMMAND """'||gcommand||'"""'
  338. end
  339. string ID S3
  340. if result ~= '' then line = line||' PORT '||result
  341. string ID S4
  342. if result ~= '' then line = line||' HELP """'||result||'"""'
  343. string ID S5
  344. if result ~= '' then line = line||' NODE '||result
  345. string ID S6
  346. if result ~= '' then line = line||' POS '||result
  347. check ID C1
  348. if result then line = line||' INSERT'
  349. check ID C2
  350. if result then line = line||' NODUP'
  351. check ID C3
  352. if result then line = line||' TOGGLE'
  353. line = line||get_attrs()
  354. string ID S7
  355. if result ~= '' then line = line||' STRING '||result
  356. call finish line
  357. return
  358.  
  359. set_dirlist: procedure
  360. parse arg obj
  361.  
  362. line = obj
  363. string ID S1
  364. if result ~= '' then line = line||' ID '||result
  365. popasl ID S2
  366. gcommand = result
  367. if gcommand ~= '' then do
  368.     cycle ID L1
  369.     line = line||' '||upper(result)||' COMMAND """'||gcommand||'"""'
  370. end
  371. string ID S3
  372. if result ~= '' then line = line||' PORT '||result
  373. string ID S4
  374. if result ~= '' then line = line||' HELP """'||result||'"""'
  375. string ID S5
  376. if result ~= '' then line = line||' NODE '||result
  377. string ID S6
  378. if result ~= '' then line = line||' PATH "'||result||'"'
  379. string ID S7
  380. if result ~= '' then line = line||' PATTERN "'||result||'"'
  381. check ID C1
  382. if result then line = line||' REREAD'
  383. check ID C2
  384. if result then line = line||' TOGGLE'
  385. line = line||get_attrs()
  386. call finish line
  387. return
  388.  
  389. set_volumelist: procedure
  390. parse arg obj
  391.  
  392. line = obj
  393. string ID S1
  394. if result ~= '' then line = line||' ID '||result
  395. popasl ID S2
  396. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  397. string ID S3
  398. if result ~= '' then line = line||' PORT '||result
  399. string ID S4
  400. if result ~= '' then line = line||' HELP """'||result||'"""'
  401. string ID S5
  402. if result ~= '' then line = line||' NODE '||result
  403. line = line||get_attrs()
  404. call finish line
  405. return
  406.  
  407. set_object: procedure
  408. parse arg obj
  409.  
  410. line = obj
  411. string ID S1
  412. if result ~= '' then line = line||' ID '||result
  413. popasl ID S2
  414. if result ~= '' then line = line||' COMMAND """'||result||'"""'
  415. string ID S3
  416. if result ~= '' then line = line||' PORT '||result
  417. string ID S4
  418. if result ~= '' then line = line||' HELP """'||result||'"""'
  419. string ID S5
  420. if result ~= '' then line = line||' NODE '||result
  421. string ID S6
  422. if result ~= '' then line = line||' CLASS "'||result||'"'
  423. string ID S7
  424. if result ~= '' then line = line||' TRIG '||result
  425. string ID S8
  426. if result ~= '' then line = line||' VAL '||result
  427. check ID C1
  428. if result then line = line||' BOOPSI'
  429. line = line||get_attrs()
  430. call finish line
  431. return
  432.  
  433. set_application: procedure
  434. parse arg obj
  435.  
  436. line = obj||get_attrs()
  437. call finish line
  438. return
  439.  
  440. set_method: procedure
  441. parse arg obj
  442.  
  443. line = obj
  444. string ID S1
  445. if result ~= '' then line = line||' ID '||result
  446. i = 0
  447. do forever
  448.     list ID ALST POS i
  449.     aname = result
  450.     if aname = '' then break
  451.     line = line||' '||strip(aname)
  452.     i = i + 1
  453. end
  454. call finish line
  455. return
  456.  
  457. set_generic: procedure
  458.  
  459. line = ''
  460. string ID P1
  461. if result ~= '' then line = result
  462. call finish line
  463. return
  464.  
  465. finish: procedure
  466. parse arg line
  467.  
  468. List_Active =                     0x8042391c /* V4  isg LONG              */
  469.  
  470. window ID SET CLOSE
  471. list ID DLST ATTRS List_Active
  472. n = result
  473. list ID DLST POS n STRING '='||line
  474. return
  475.  
  476. get_attrs: procedure
  477.  
  478. line = ''
  479. i = 0
  480. do forever
  481.     list ID ALST POS i
  482.     aname = result
  483.     if aname = '' then break
  484.     if i = 0 then line = line||' ATTRS'
  485.     parse var aname name',='value
  486.     if strip(value) ~= '' then line = line||' '||strip(name)||' '||strip(value)
  487.     i = i + 1
  488. end
  489. return line
  490.